package cn.iocoder.yudao.module.pplan.dal.mysql.recipemeal;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.module.pplan.controller.admin.recipemeal.vo.RecipeMealPageReqVO;
import cn.iocoder.yudao.module.pplan.dal.dataobject.recipemeal.RecipeMealDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 生产计划-餐谱菜品数据管理 Mapper
 *
 * @author yisl
 */
@Mapper
public interface RecipeMealMapper extends BaseMapperX<RecipeMealDO> {

    default PageResult<RecipeMealDO> selectPage(RecipeMealPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RecipeMealDO>()
                .eqIfPresent(RecipeMealDO::getMealCode, reqVO.getMealCode())
                .likeIfPresent(RecipeMealDO::getMealName, reqVO.getMealName())
                .eqIfPresent(RecipeMealDO::getAirlineId, reqVO.getAirlineId())
                .eqIfPresent(RecipeMealDO::getMealType, reqVO.getMealType())
                .eqIfPresent(RecipeMealDO::getIsActive, reqVO.getIsActive())
                .eqIfPresent(RecipeMealDO::getRemarks, reqVO.getRemarks())
                .betweenIfPresent(RecipeMealDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(RecipeMealDO::getId));
    }

}